﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/AdminDefault.Master"
  AutoEventWireup="true" CodeBehind="CustomerContact.aspx.cs" Inherits="NguyenHoa.Web.Admin.CustomerContact" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <table>
    <tr>
      <td>
        <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:Strings, FromDate %>"></asp:Literal>
        :
      </td>
      <td>
        <dxe:ASPxDateEdit ID="dexFromDate" ClientInstanceName="dexFromDate" runat="server"
          Width="150px" AllowNull="False">
          <ButtonStyle Width="13px">
          </ButtonStyle>
          <ValidationSettings>
            <ErrorImage Height="14px" Width="14px" />
            <ErrorFrameStyle ImageSpacing="4px">
              <ErrorTextPaddings PaddingLeft="4px" />
            </ErrorFrameStyle>
          </ValidationSettings>
          <CalendarProperties>
            <HeaderStyle Spacing="1px" />
            <FooterStyle Spacing="4px" />
          </CalendarProperties>
        </dxe:ASPxDateEdit>
      </td>
      <td width="10px">
      </td>
      <td>
        <asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Strings, ToDate %>"></asp:Literal>
        :
      </td>
      <td>
        <dxe:ASPxDateEdit ID="dexToDate" ClientInstanceName="dexToDate" runat="server" Width="150px"
          AllowNull="False">
          <ButtonStyle Width="13px">
          </ButtonStyle>
          <ValidationSettings>
            <ErrorImage Height="14px" Width="14px" />
            <ErrorFrameStyle ImageSpacing="4px">
              <ErrorTextPaddings PaddingLeft="4px" />
            </ErrorFrameStyle>
          </ValidationSettings>
          <CalendarProperties>
            <HeaderStyle Spacing="1px" />
            <FooterStyle Spacing="4px" />
          </CalendarProperties>
        </dxe:ASPxDateEdit>
      </td>
      <td width="10px">
      </td>
      <td>
        <dxe:ASPxButton ID="ASPxButton1" runat="server" Text="<%$ Resources:Strings, View %>"
          AutoPostBack="false">
          <ClientSideEvents Click="function(s,e){onSearch();}"></ClientSideEvents>
        </dxe:ASPxButton>
      </td>
    </tr>
  </table>
  <div style="padding-top: 20px;">
    <dxwgv:ASPxGridView ID="gvList" runat="server" AutoGenerateColumns="False" ClientInstanceName="gvList"
      KeyFieldName="Id" Width="100%" OnCustomJSProperties="gvList_CustomJSProperties"
      OnCustomCallback="gvList_CustomCallback" OnHtmlDataCellPrepared="gvList_HtmlDataCellPrepared"
      OnCommandButtonInitialize="gvList_CommandButtonInitialize" OnRowDeleting="gvList_RowDeleting">
      <SettingsBehavior ConfirmDelete="True" />
      <Styles>
        <Header ImageSpacing="5px" SortingImageSpacing="5px">
        </Header>
      </Styles>
      <SettingsPager>
        <AllButton>
          <Image Height="19px" Width="28px" />
        </AllButton>
        <FirstPageButton>
          <Image Height="19px" Width="23px" />
        </FirstPageButton>
        <LastPageButton>
          <Image Height="19px" Width="23px" />
        </LastPageButton>
        <NextPageButton>
          <Image Height="19px" Width="19px" />
        </NextPageButton>
        <PrevPageButton>
          <Image Height="19px" Width="19px" />
        </PrevPageButton>
        <Summary AllPagesText="<%$Resources:Strings, PagerText %>" Text="<%$Resources:Strings, PagerText %>" />
      </SettingsPager>
      <SettingsEditing Mode="Inline" />
      <Images>
        <CollapsedButton Height="14px" Width="13px" />
        <ExpandedButton Height="13px" Width="13px" />
        <DetailCollapsedButton Height="13px" Width="13px" />
        <DetailExpandedButton Height="13px" Width="13px" />
        <HeaderFilter Height="19px" Width="19px" />
        <HeaderActiveFilter Height="19px" Width="19px" />
        <HeaderSortDown Height="3px" Width="6px" />
        <HeaderSortUp Height="3px" Width="6px" />
        <FilterRowButton Height="13px" Width="13px" />
        <CustomizationWindowClose Height="18px" Width="18px" />
        <PopupEditFormWindowClose Height="18px" Width="18px" />
        <WindowResizer Height="12px" Width="12px" />
        <FilterBuilderClose Height="18px" Width="18px" />
      </Images>
      <Columns>
        <dxwgv:GridViewCommandColumn ButtonType="Image" VisibleIndex="0" Width="40px" 
          Caption=" ">
          <EditButton>
            <Image Url="~/images/edit.png" />
          </EditButton>
          <NewButton>
            <Image Url="~/images/add.png" />
          </NewButton>
          <DeleteButton Visible="True">
            <Image Url="~/images/delete.png" />
          </DeleteButton>
          <CancelButton>
            <Image Url="~/images/undo.gif" />
          </CancelButton>
          <UpdateButton>
            <Image Url="~/images/save.png" />
          </UpdateButton>
          <HeaderStyle HorizontalAlign="Center" />
          <CellStyle Cursor="pointer">
          </CellStyle>
        </dxwgv:GridViewCommandColumn>
        <dxwgv:GridViewDataDateColumn FieldName="Date" VisibleIndex="1" Caption="<%$ Resources:Strings, Date %>"
          ReadOnly="True">
        </dxwgv:GridViewDataDateColumn>
        <dxwgv:GridViewDataTextColumn VisibleIndex="2" Caption="<%$ Resources:Strings, FullName %>"
          FieldName="Fullname" ReadOnly="True">
          <HeaderStyle HorizontalAlign="Center" />
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Email" VisibleIndex="3" Caption="<%$ Resources:Strings, Email %>"
          ReadOnly="True">
          <HeaderStyle HorizontalAlign="Center" />
          <DataItemTemplate>
            <a onclick="openDetail('<%#Eval("Type") %>','<%#Eval("Id") %>')">
              <%#Eval("Email") %>
            </a>
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Phone" VisibleIndex="4" Caption="<%$ Resources:Strings, Phone %>"
          ReadOnly="True">
          <HeaderStyle HorizontalAlign="Center" />
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Address" VisibleIndex="5" Caption="<%$ Resources:Strings, Address %>"
          ReadOnly="True">
          <HeaderStyle HorizontalAlign="Center" />
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataMemoColumn FieldName="Opinion" VisibleIndex="6" Caption="<%$ Resources:Strings, Content %>"
          ReadOnly="True">
          <HeaderStyle HorizontalAlign="Center" />
        </dxwgv:GridViewDataMemoColumn>
        <dxwgv:GridViewDataTextColumn FieldName="IsActive" VisibleIndex="7" Caption="<%$ Resources:Strings, IsProcessed %>">
          <HeaderStyle HorizontalAlign="Center" />
          <CellStyle HorizontalAlign="Center">
          </CellStyle>
          <DataItemTemplate>
            <input id="ckbox" runat="server" type="checkbox" />
          </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
      </Columns>
      <StylesEditors>
        <ProgressBar Height="29px">
        </ProgressBar>
      </StylesEditors>
      <ImagesEditors>
        <CalendarPrevYear Height="19px" Width="23px" />
        <CalendarPrevMonth Height="19px" Width="19px" />
        <CalendarNextMonth Height="19px" Width="19px" />
        <CalendarNextYear Height="19px" Width="23px" />
      </ImagesEditors>
      <SettingsText ConfirmDelete="<%$Resources:Messages,ERR0006 %>" />
      <ClientSideEvents EndCallback="function(s, e){ongvList_EndCallback(s,e);}" />
    </dxwgv:ASPxGridView>
  </div>

  <script type="text/javascript" language="javascript">

    function checkChange(id, show) {
      gvList.PerformCallback('checkChange|' + id + '|' + show);
    }
    function onSearch() {
      gvList.PerformCallback();
    }

    function onCheckedChanged(id) {
      gvList.PerformCallback('Change|' + id);
    }
    function ongvList_EndCallback(s, e) {
      var error = s.cpInnerError;
      if (error != '') {
        alertMessage(error);
        return;
      }
    }
    function openDetail(type, id) {
      window.location.href = 'CustomerContactDetail.aspx?t=' + type + '&id=' + id;
    }
  </script>

</asp:Content>
